<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Class类</title>
	</head>
	<body>
		<script>
			function Phone(brand,price) {
				this.brand = brand;
				this.price = price;
			}
			
			Phone.prototype.call = function() {
				console.log('我可以打电话');
			}
			
			let hw = new Phone('华为',3999);
			hw.call();
			console.log(hw);
			class Shouji {
				constructor(brand,price) {
					this.brand = brand;
					this.price = price;
				}
				// 方法必须使用该语法,不能使用ES5的对象完整形式
				call() {
					console.log('开始打电话......');
				}
			}
			let onePlus = new Shouji('1+++',999);
			console.log(onePlus);
		</script>
	</body>
</html>